<!doctype html> 
<html> 
<head> 
    <meta charset="utf-8"> 
    <title></title>
    <script type="text/javascript" src='jquery-1.9.1.min.js'></script> 
    <style type="text/css">
*{margin: 0;padding: 0;}
body,html{height: 100%;}
div{
	width:100px;height: 100px;background: black;display: block;

}

    </style>
</head>
<body>
<div></div>
<div id='div1'></div>
<div></div>
<script type="text/javascript">

	function $(dom){
		return new Jquery(dom);
	};
	function Jquery(dom){
		//alert(dom)
		this.arr = [];
		switch(dom.charAt(0)){
			case '.' :
			alert('类选择')
			break;
			case '#' :
			//alert(dom.substring(1))
			this.arr.push(document.getElementById(dom.substring(1)));
			//alert(this.arr);
			//alert('id选择')
			break;
			default:
			alert('标签')
			break;
		}
	};
	Jquery.prototype = {
		'css':function(){
			this.arr[0]['style'][arguments[0]] = arguments[1]
			//alert(arguments[0])
		}
	};
	$('#div1').css('background','yellow');

</script>
</body>
</html>